import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "Index",
    component: () => import("@/view/index.vue"),
    meta: { title: "主页" },
  },
  {
    path: "/ClassRoom",
    name: "ClassRoom",
    component: () => import("@/view/classRoom.vue"),
    meta: { title: "教室" },
  },
  {
    path: "/dormitory",
    name: "Dormitory",
    component: () => import("@/view/dormitory.vue"),
    meta: { title: "寝室" },
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("@/view/home.vue"),
    meta: { title: "家" },
  },
  {
    path: "/playground",
    name: "Playground",
    component: () => import("@/view/playground.vue"),
    meta: { title: "操场" },
  },
  {
    path: "/canteen",
    name: "Canteen",
    component: () => import("@/view/canteen.vue"),
    meta: { title: "食堂" },
  },
  {
    path: "/walk",
    name: "Walk",
    component: () => import("@/view/walk.vue"),
    meta: { title: "走路" },
  },
  {
    path: "/library",
    name: "Library",
    component: () => import("@/view/library.vue"),
    meta: { title: "图书馆" },
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes: [...routes],
});

export default router;
